// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  db = cloud.database()
  const _  = db.command
  return  await db.collection('flower').where({
    _id:event._id
  }).update({
    data: {
      gross:event.gross - event.num
    }
  })

}